﻿//-----------------------------------------------------------------------
// <copyright file="IDbFacade.cs" company="FER">
//     Copyright (c) All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace NMBP.DAL
{
    using System.Collections.Generic;
    using NMBP.Models;

    /// <summary>
    /// Interface implemented by database facade classes in store
    /// </summary>
    public interface IDbFacade
    {
        #region Person
        /// <summary>
        /// Gets person from database based on username and password
        /// </summary>
        /// <param name="username">person username</param>
        /// <param name="password">person password</param>
        /// <returns>list of persons</returns>
        Person GetPerson(string username, string password);

        /// <summary>
        /// Gets all persons
        /// </summary>
        /// <returns>Lisf of persons in db</returns>
        List<Person> GetPersons();

        /// <summary>
        /// Saves person to database
        /// </summary>
        /// <param name="person">Person object</param>
        void SavePerson(Person person);

        /// <summary>
        /// Deletes person from db
        /// </summary>
        /// <param name="person">person to be deleted</param>
        void DeletePerson(Person person);
        #endregion

        #region Worker
        /// <summary>
        /// Gets list of all workers
        /// </summary>
        /// <returns>list of workers</returns>
        List<Worker> GetWorkers();

        /// <summary>
        /// Saves worker to database
        /// </summary>
        /// <param name="worker">worker to be saved</param>
        void SaveWorker(Worker worker);
        #endregion

        #region Customer
        /// <summary>
        /// Gets list of all customers
        /// </summary>
        /// <returns>list of customers</returns>
        List<Customer> GetCustomers();

        /// <summary>
        /// Saves customer to database
        /// </summary>
        /// <param name="customer">customer to be saved to db</param>
        void SaveCustomer(Customer customer);
        #endregion

        #region Product
        /// <summary>
        /// Get all products
        /// </summary>
        /// <returns>List of products</returns>
        List<Product> GetProducts();

        /// <summary>
        /// Saves one product
        /// </summary>
        /// <param name="product">product item</param>
        void SaveProduct(Product product);

        /// <summary>
        /// Saves list of products
        /// </summary>
        /// <param name="products">list of products</param>
        void SaveProducts(List<Product> products);
        #endregion

        #region Department
        /// <summary>
        /// Gets departments from database
        /// </summary>
        /// <returns>list of departments</returns>
        List<Department> GetDepartments();

        /// <summary>
        /// Save department
        /// </summary>
        /// <param name="department">department to be stored to db</param>
        void SaveDepartment(Department department);

        /// <summary>
        /// Save departments to db
        /// </summary>
        /// <param name="departments">departments to be stored to db</param>
        void SaveDepartments(List<Department> departments);
        #endregion

        #region Cart

        /// <summary>
        /// Gets all carts
        /// </summary>
        /// <returns>list of carts</returns>
        List<Cart> GetCarts();

        /// <summary>
        /// Gets customers unorderd cart if any
        /// </summary>
        /// <param name="customer">customer owner of cart</param>
        /// <returns>customers unordered cart or null</returns>
        Cart GetCustomerUnorderedCart(Customer customer);

        /// <summary>
        /// Save cart to db
        /// </summary>
        /// <param name="cart">cart to be saved</param>
        void SaveCart(Cart cart);

        #endregion

        #region Order
        /// <summary>
        /// Gets all pending orders from db
        /// </summary>
        /// <returns>list of pending orders</returns>
        List<Order> GetPendingOrders();

        /// <summary>
        /// Gets old orders from db
        /// </summary>
        /// <returns>list of old orders</returns>
        List<Order> GetOldOrders();

        /// <summary>
        /// Saves order to db
        /// </summary>
        /// <param name="order">order to be saved to db</param>
        void SaveOrder(Order order);
        #endregion

        #region Supplier

        /// <summary>
        /// Gets all suppliers from db
        /// </summary>
        /// <returns>list of suppliers</returns>
        List<Supplier> GetSuppliers();

        /// <summary>
        /// Saves supplier to db
        /// </summary>
        /// <param name="supplier">supplier to be saved</param>
        void SaveSupplier(Supplier supplier);

        /// <summary>
        /// Saves suppliers to db
        /// </summary>
        /// <param name="supplier">suppliers to be saved</param>
        void SaveSuppliers(List<Supplier> supplier);
        #endregion
    }
}
